package com.hgyc.mom.wms.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.hgyc.mom.common.annotation.Excel;
import com.hgyc.mom.core.annotation.DictColumn;
import com.hgyc.mom.core.annotation.TableDict;
import com.hgyc.mom.core.mybatis.EQ;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * <p>
 * 销售订单明细
 * </p>
 *
 * @author fwj
 * @since 2025-05-19
 */
@Data
@TableName("crm_sales_detail")
@Schema(name="销售订单明细对象", description="销售订单明细对象")
public class CrmSalesDetail implements Serializable {
    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private Long id;

    @EQ
    @Schema(description = "销售单ID")
    private Long orderId;

    @Excel(name = "物料ID")
    @EQ
    @Schema(description = "物料ID")
    @TableDict(table = "base_material", key = "id" , columns = {
            @DictColumn(name ="material_code", alias = "materialCode"),
            @DictColumn(name = "material_name", alias = "materialName")
    })
    private Long materialId;

    @EQ
    @Schema(description = "状态")
    private String status;

    @Excel(name = "数量")
    @Schema(description = "数量")
    private Long qty;

    @Excel(name = "发货日期")
    @Schema(description = "发货日期")
    private LocalDate shipmentDate;

    @Excel(name = "实际发货日期")
    @Schema(description = "实际发货日期")
    private LocalDate actualShipmentDate;

    @Schema(description = "已发货数量")
    private Long shippedQty;

    @Excel(name = "备注")
    @Schema(description = "备注")
    private String remark;

    @TableField(fill = FieldFill.INSERT)
    @Schema(description = "创建人")
    private Long createBy;

    @TableField(fill = FieldFill.INSERT)
    @Schema(description = "创建时间")
    private LocalDateTime createTime;

    @TableField(fill = FieldFill.UPDATE)
    @Schema(description = "修改人")
    private Long updateBy;

    @TableField(fill = FieldFill.UPDATE)
    @Schema(description = "修改时间")
    private LocalDateTime updateTime;

}